import ajax from '../utils/request.js'

// 获取用户图片素材
const getList = params => {
  return ajax({
    url: '/mp/v1_0/user/images',
    method: 'get',
    params
  })
}

// 删除用户图片
const deleteImage = data => {
  const { id } = data
  return ajax({
    url: `/mp/v1_0/user/images/${id}`,
    method: 'DELETE'
  })
}

// 收藏用户图片
const collectImage = data => {
  const { id, collect } = data
  return ajax({
    url: `/mp/v1_0/user/images/${id}`,
    method: 'PUT',
    data: {
      collect
    }
  })
}

export { getList, collectImage, deleteImage }
